package edu.mercer.sse.bkp;

/**
 * Convert errors between types.<p>
 * 
 * Visitor Pattern:<br> 
 * 
 * Interface for visitor which converts between checked and
 * 	unchecked exceptions.<p> 
 * 
 * Can be implemented to provide conversion into different types of 
 * 	exceptions. Suggested usage: application specific exceptions, possibly
 * 	supporting other visitors for logging.
 *
 * @param <E> - Checked Exception
 * @param <R> - UnChecked Exception
 */

public interface BackupErrorConversion<E extends Exception, 
									   R extends RuntimeException>
{
	/**
	 * Convert checked exception into unchecked.<p>
	 * 
	 * @param err - Exception: checked
	 * 
	 * @return  Exception: unchecked
	 */
	
	R visit( E err );

	
	/**
	 * Convert Unchecked exception into checked.<p>
	 * 
	 * @param err - Exception: unchecked
	 * 
	 * @return  Exception: checked
	 */
	
	E visit( R err );
	
	
}//interface
